<!DOCTYPE html>
<html>
<head>
    <title>LookRedis</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="/public/favicon.ico" type="image/x-icon">
    <!-- 引入 Bootstrap -->
    <link href="/public/bootstrap-3.3.7-dist/css/bootstrap.css" rel="stylesheet">
    <link href="/public/css/index.css" rel="stylesheet">
</head>
<body>
<div id="root">
    <div class="row" v-clock>
        <div class="col-md-4">
            <div class="pin">
                <div class="panel panel-default">
                    <div class="panel-heading text-center">
                        <span class="left" @click="flag=0">LookRedis</span>
                        <div class="btn-group-vertical">
                            <div @click="flag=1">
                                <strong class="text-success">{{env.env}}</strong>
                                <span class="caret"></span>
                            </div>
                            <ul class="dropdown-menu one-select" v-show="flag==1">
                                <li v-for="item in env.envList" @click="changeEnv(item)"><a
                                        href="javascript:;">{{item}}</a></li>
                            </ul>
                        </div>
                        <div class="btn item" v-for="item in db" @click="changeDB(item)" :ref="item">
                            {{item}}
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="input-group">
                                <input type="text" class="form-control" v-model="op.name" placeholder="键...">
                                <br>
                                <textarea type="text" rows="3" v-model="op.value" class="form-control"
                                          placeholder="值..."
                                ></textarea>
                                <div class="input-group-addon btn-success" @click="setData">设置</div>
                                <div class="input-group-addon btn-primary" @click="getData">获取</div>
                            </div>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <input class="form-control" v-model="keys">
                        </div>
                        <div class="panel-body table-list">
                            <div class="btn item" v-for="item in dataKey" @click="queryData(item)" :ref="item">
                                {{item}}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-8">
            <div class="row">
                <div class="panel panel-default ">
                    <div class="panel-heading"><strong @click="queryTTL" style="cursor: pointer;">TTL {{ttl}}</strong>　　 {{date}}
                        <div class="input-group">
                            <div class="input-group-addon btn-success" @click="queryData(selectName)">刷新</div>
                            <input class="form-control" v-model="selectName">
                            <div class="input-group-addon btn-danger" @click="delData">×</div>
                        </div>
                    </div>
                    <div class="panel-body">
                         <pre class="table-data">{{value}}

                         </pre>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/public/js/common.js"></script>
<script src="/public/js/vue.min.js"></script>
<script src="/public/js/axios.min.js"></script>
<script src="/public/js/index.js"></script>
</body>
</html>